<!DOCTYPE html>
<html lang="en" xmlns:v-once="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>v-once</title>
</head>
<body>
  <!--v-once,保证数值不被改变-->

    <div id="div1">
        <h2>{{message}}</h2>
        <h2 v-once>{{message}}</h2>
        <button @click="changeMsg()">改变</button>
    </div>
  <script src="./js/vue.js"></script>
  <script>
      var mv = new Vue({
          el:"#div1",
          data:{
              message: "这是一个消息"
          },
          methods:{
              changeMsg(){
                  this.message = "消息改变";
              }
          }
      })
  </script>
</body>
</html>